package org.xiaobai.ai.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter;
import org.xiaobai.ai.entity.ChatPaperVO;
import org.xiaobai.ai.request.ChatPaperCreateRequest;
import org.xiaobai.ai.request.ChatPaperGenerateRequest;
import org.xiaobai.ai.request.ChatPaperQueryRequest;

import java.io.IOException;

/**
 * @author dingfeng.xiao
 * @description 论文service
 * @date 2023/8/16 10:39
 */
public interface ChatPaperService extends IService<ChatPaperVO> {

    /**
     * 用户 生成记录
     * @param queryRequest
     * @return
     */
    Page<ChatPaperVO> paperMy(ChatPaperQueryRequest queryRequest);
    /**
     * 创建论文信息
     *
     * @return 论文id
     */
    Long paperCreate(ChatPaperCreateRequest createRequest);

    /**
     * 论文id
     *
     * @param paperId
     * @return sse
     */
    ResponseBodyEmitter paperStart(Long paperId);

    /**
     * 生成论文
     *
     * @param generateRequest
     * @return
     */
    ResponseBodyEmitter paperGenerate(ChatPaperGenerateRequest generateRequest);

    /**
     * 导出论文
     *
     * @param paperId
     * @param exportType
     */
    String paperExport(Long paperId, String exportType) throws IOException;
}
